-- CALC_SKY_EVENT_BONUS

-- 计算天空探索的奖励
-- @param eventId        事件Id
-- @param exploreLevel   探索等级
return function(eventId, exploreLevel, camp)
    local ret = {};
    local eventConfig = SkyExploreM.query(eventId);
    local prop;

    -- 根据不同的rule获取不同的奖励配置
    if eventConfig.rule == "boss" then
        -- 古遗迹碎片
        local count = math.floor((420 + 32 * exploreLevel) / 100) * 20;
        table.insert(ret, {["class_id"] = 10000, ["count"] = count});

        -- 谜の雕像
        table.insert(ret, BonusItemDescM.query(5));
        -- 飞艇芯片
        table.insert(ret, BonusItemDescM.query(1));
        -- 能量晶核
        table.insert(ret, BonusItemDescM.query(6));

    elseif eventConfig.rule == "player" then
        -- 古遗迹碎片
        local count = math.floor(math.floor((420 + 32 * exploreLevel) / 100) * 2.5);
        table.insert(ret, {["class_id"] = 10000, ["count"] = count});

        -- 谜の雕像
        table.insert(ret, BonusItemDescM.query(5));
        -- 神殿の契约
        table.insert(ret, BonusItemDescM.query(2));
        -- 飞艇芯片
        table.insert(ret, BonusItemDescM.query(1));
    elseif eventConfig.rule == "monster" then
        -- 古遗迹碎片,有加成
        local count = math.floor((420 + 32 * exploreLevel) / 100) * 4;
        prop = PropM.combine(ME.user, "sky_explore_scrap", 2);
        count = PropM.apply(prop, count);

        table.insert(ret, {["class_id"] = 10000, ["count"] = count});

        -- 神殿の契约
        table.insert(ret, BonusItemDescM.query(2));
        -- 飞艇芯片
        table.insert(ret, BonusItemDescM.query(1));
        -- 飞艇改造材料
        table.insert(ret, BonusItemDescM.query(3));
    elseif eventConfig.rule == "whirlpool" then
        -- 古遗迹碎片，有加成
        local count = math.floor((420 + 32 * exploreLevel) / 100) * 50;
        prop = PropM.combine(ME.user, "rift_bonus", 1);
        count = PropM.apply(prop, count);

        table.insert(ret, {["class_id"] = 10000, ["count"] = count});

        -- 谜の雕像
        table.insert(ret, BonusItemDescM.query(5));

        -- 神殿の契约
        table.insert(ret, BonusItemDescM.query(2));

        -- 飞艇芯片
        table.insert(ret, BonusItemDescM.query(1));

        -- 史莱姆碎片
        local petClassId = FormulaM.invoke("CALC_WHIRLPOOL_PET_SCRAP_ID", camp);
        table.insert(ret, {["class_id"] = petClassId, ["count"] = 1});

        -- 飞艇改造材料
        table.insert(ret, BonusItemDescM.query(3));

        -- 电池包
        table.insert(ret, {["class_id"] = 10003, ["count"] = 1});

        -- 金币
        table.insert(ret, {["class_id"] = "money", ["count"] = 1});
    end

    return ret;
end
